package com.company.project.controller.ldjsc.robot;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import cn.dev33.satoken.annotation.SaCheckPermission;
import com.company.project.entity.ldjsc.robot.JscIndexEntity;
import com.company.project.service.ldjsc.robot.JscIndexService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.stereotype.Controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.core.metadata.IPage;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import java.util.List;
import com.company.project.common.utils.DataResult;





/**
 *
 *
 * @author wenbin
 * @email *****@mail.com
 * @date 2025-10-22 10:30:27
 */
@Controller
@RequestMapping("/")
public class JscIndexController {
    @Autowired
    private JscIndexService jscIndexService;

    @ApiOperation(value = "新增")
    @PostMapping("jscIndex/add")
    @SaCheckPermission("jscIndex:add")
    @ResponseBody
    public DataResult add(@RequestBody JscIndexEntity jscIndex){
            jscIndexService.save(jscIndex);
        return DataResult.success();
    }

    @ApiOperation(value = "删除")
    @DeleteMapping("jscIndex/delete")
    @SaCheckPermission("jscIndex:delete")
    @ResponseBody
    public DataResult delete(@RequestBody @ApiParam(value = "id集合") List<String> ids){
            jscIndexService.removeByIds(ids);
        return DataResult.success();
    }

    @ApiOperation(value = "更新")
    @PutMapping("jscIndex/update")
    @SaCheckPermission("jscIndex:update")
    @ResponseBody
    public DataResult update(@RequestBody JscIndexEntity jscIndex){
            jscIndexService.updateById(jscIndex);
        return DataResult.success();
    }



}
